import { Component } from "react";
import Son from "./components/Son";
class Parent extends Component{
  state={
    money:1e6
  }
  addMoney=(add)=>{
    
    this.setState({
      money:this.state.money+add
    })
  }
  render(){
    return(
      <div>
        <h1>父组件</h1>
        <hr />
        <Son money={this.state.money} addMoney={this.addMoney}></Son>
      </div>
    )
  }
}
export default Parent